<?
class Cltable{	
    public static $emptyTable;
	public $carray;
	public $tableContent;
    public function __construct($arr='empty',$sWidth='65px'){
		self::setEmptyTable();
		$this->tableContent=array();
		$this->checkArray($arr);
		$arrcontent=$this->carray;
		$this->mkContent($arrcontent,$sWidth);
	}
	public static function setBg($num){
		if( ($num%2)==0 ){
			return "#f0f0f0;";
		}else{
			return "#fcfcfc;";
		}
	}
    public function export($arr='empty',$sWidth='65px'){
		if($arr=='empty'){
			 echo Cltable::$emptyTable;	
			foreach( $this->tableContent as $k=>$v){
				echo $v;	
			}
			 echo '</table>';
		}else{
			$this->exportArr($arr,$sWidth);
		}
	}
	public function exportArr($arr,$sWidth='65px'){
	    $this->mkContent($arr,$sWidth);	
		$this->export();
	}
	public function mkContent($arr,$sWidth){	
	    $i=0;
		$this->tableContent=array();
		foreach( $arr as $k=>$v){
		
			$this->tableContent[]=
			 "<tr ><td  class='num' "
			 ." style='display:block;color:#999;font-size:18px;"
			 ."width:".$sWidth.";overflow:hidden;'><b>".$k
             ."</b></td><td style='border-color:#33cc33;width:4000px;"
			 ." border-left-style:solid; border-left-width:4px;"
			 ."height:12px; padding-left:2px;background-color:"
			 .self::setBg($i)."'>".$v."</td></tr>";
			 $i++;
		}
		
    }
	public function __destruct(){}	
	public function checkArray($arr){
	    if( !is_array($arr) ){
			$arr=array('Is not array!');
		}
		$this->carray=$arr;
	}
	public static function setEmptyTable(){
	   Cltable::$emptyTable =
	   '<table   border="0" cellspacing="0" cellpadding="0" >';	
	}
	
}

 
?>